package org.example.springboot.controller;

import io.swagger.v3.oas.annotations.Operation;
import lombok.AllArgsConstructor;
import org.example.springboot.common.page.PageResult;
import org.example.springboot.common.utils.Result;
import org.example.springboot.query.FmcControlQuery;
import org.example.springboot.query.IrrigationUnitQuery;
import org.example.springboot.service.FmcControlService;
import org.example.springboot.vo.FmcControlVO;
import org.example.springboot.vo.IrrigationUnitVO;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import lombok.extern.slf4j.Slf4j;

import javax.annotation.Resource;
import java.util.List;


@Slf4j
@RestController
@RequestMapping("/control")
@AllArgsConstructor
public class FmcControlController {
    @Resource
    private final FmcControlService fmcControlService;

    @PostMapping("page")
    public Result<PageResult<FmcControlVO>> page(@RequestBody FmcControlQuery query) {
        PageResult<FmcControlVO> page = fmcControlService.page(query);
        return Result.ok(page);
    }

}